/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"B97DC233-E329-4D43-8FF4-90F443DAF254"}
 */
function aceptar(event) {
	importe_signo = importe
	cod_mov = 2
	if (databaseManager.saveData())
	{
		databaseManager.setAutoSave(true)
		var $win = application.getWindow('ALTA_DEUDA')
		$win.hide()
		$win.destroy()
		forms.liquidaciones_tbl.controller.recreateUI()
	}
	else
	{
		globals.DIALOGS.showErrorDialog('Error','Ocurrio un error','OK')
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"2CC958F8-2E00-40C8-B0B8-69392ECF72A3"}
 */
function cancelar(event) {
	databaseManager.revertEditedRecords()
	databaseManager.setAutoSave(true)
	var $win = application.getWindow('ALTA_DEUDA')
	$win.hide()
	$win.destroy()
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"D4130D27-663E-4E55-B398-B5613087A617"}
 */
function onShow(firstShow, event) {
	databaseManager.setAutoSave(false)
	controller.newRecord()
	elements.fld_unidad.requestFocus()
}
